# Contributor: Alex McGrath <amk@amk.ie>
# Maintainer: Alex McGrath <amk@amk.ie>
pkgname=mupen64plus
pkgver=2.5
pkgrel=3
pkgdesc="Mupen64Plus is a cross-platform plugin-based N64 emulator."
url="https://mupen64plus.org/"
# build fails or is not officially supported for this release for all but x86_64
arch="x86_64"
license="GPL-2.0-only"
makedepends="
	boost-dev
	freetype-dev
	glu-dev
	libpng-dev
	libsamplerate-dev
	sdl2-dev
	zlib-dev
	"
source="https://github.com/mupen64plus/mupen64plus-core/releases/download/$pkgver/mupen64plus-bundle-src-$pkgver.tar.gz
	gcc.patch
	fix-null-usage.patch
	"
options="!check" # no test suite
subpackages="$pkgname-doc"
builddir="$srcdir/mupen64plus-bundle-src-$pkgver"

build() {
	PIE=1 USE_GLES=1 ./m64p_build.sh
}

package() {
	./m64p_install.sh DESTDIR="$pkgdir" PREFIX='/usr'
}

sha512sums="
08e9dbf1d851ede561419b1edbae51b46e775e01e33c870ed8b8c2809965a858b21c342804a88f3fd837c83e0c1b5007e45ca9fb9cdf82499b04240b9c799ba8  mupen64plus-bundle-src-2.5.tar.gz
9853bbb02fff179767c1499772ccb7dce4fcfd636b7bd188e9104d055943fd6e350b9edc0d8e1927fb0cc9bacedc9a6cf3f4972a5866da57ae3ca32d232b9582  gcc.patch
233f9f8e3ea6664237e3b363e8cd70a68e21b2a2eba9e65ff1a346ab318050ae526ad5f97efa4800e64456257fc263ebc8c3e21fcd6614e413b78ddf69fe7d64  fix-null-usage.patch
"
